package com.zhentao.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhentao.comm.Result;
import com.zhentao.pojo.Torder;
import com.zhentao.service.OrderService;
import com.zhentao.vo.OrderQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
public class OrderCOntroller {


    @Autowired
    private OrderService orderService;
    //门诊缴费记录
    @RequestMapping("pageQuery")
    public Result<IPage<Torder>> pageQuery(@RequestBody OrderQuery orderQuery) {
        // 调用 Service 层的分页查询方法
        IPage<Torder> orderIPage = orderService.pageQuery(orderQuery);
        return Result.success(orderIPage);
    }

    //门诊充值记录
    @RequestMapping("pageQueryRecharge")
    public Result<IPage<Torder>> pageQueryRecharge(@RequestBody OrderQuery orderQuery) {
        // 调用 Service 层的分页查询方法
        IPage<Torder> orderIPage = orderService.pageQueryRecharge(orderQuery);
        return Result.success(orderIPage);
    }
    //住院消费
    @RequestMapping("pageQueryXf")
    public Result<IPage<Torder>> pageQueryXf(@RequestBody OrderQuery orderQuery) {
        // 调用 Service 层的分页查询方法
        IPage<Torder> orderIPage = orderService.pageQueryXf(orderQuery);
        return Result.success(orderIPage);
    }
    //住院充值
    @RequestMapping("pageQueryCz")
    public Result<IPage<Torder>> pageQueryCz(@RequestBody OrderQuery orderQuery) {
        // 调用 Service 层的分页查询方法
        IPage<Torder> orderIPage = orderService.pageQueryCz(orderQuery);
        return Result.success(orderIPage);
    }



    //退款记录

    @RequestMapping("pageQueryTk")
    public Result<IPage<Torder>> pageQueryTk(@RequestBody OrderQuery orderQuery) {
        // 调用 Service 层的分页查询方法
        IPage<Torder> orderIPage = orderService.pageQueryTk(orderQuery);
        return Result.success(orderIPage);
    }









}
